<%@page import="qingke.mybatis.pojo.StoreVip"%>
<%@page import="java.util.List"%>
<%@page import="qingke.mybatis.pojo.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="${pageContext.request.contextPath }/css/personalcenter.css"
	type="text/css" rel="stylesheet" />
<link href="${pageContext.request.contextPath }/css/bootstrap.min.css"
	type="text/css" rel="stylesheet" />
<script src="${pageContext.request.contextPath }/js/jquery-1.8.3.min.js"></script>
<script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath }/js/personal.js"></script>

</head>
<%
	Object obj = session.getAttribute("user");
	User user = null;
	if (obj != null) {
		if (obj instanceof User) {
			user = (User) obj;
		}
	}
%>
<%
	Object userStoreVipObject = session.getAttribute("userStoreVip");
	List<StoreVip> userStoreVips = null;
	if (userStoreVipObject != null) {
		if (userStoreVipObject instanceof List) {
			userStoreVips = (List) userStoreVipObject;
		}
	}
%>
<body onload="getVip()">
	<div class="person-content-location">
		<a href="">当前位置</a> > <a href="">个人中心</a> > <a href="">基本信息</a>
	</div>

	<hr />
	<div class="panel-group" id="accordion1">
		<div class="panel panel-default">
			<div class="panel-heading" style="background: #1ea2b0">
				<h4 class="panel-title">
					<a data-toggle="collapse" data-parent="#accordion1"
						href="#collapseOne1">基本信息 </a>
					<button style="float: right; background: #1ea2b0; border: 0px"
						onclick="modify('basemessage1')">修改</button>
				</h4>
			</div>
			<div id="collapseOne1" class="panel-collapse collapse in">
				<div class="panel-body">
					<%
						if (user != null) {
					%>
					<form id="basemessage1" action="changeUser">
						<div>
							<label for="username">姓名 ： </label><input id="username"
								name="username" value="<%=user.getName()%>" disabled="disabled" />
						</div>
						<div>
							<label for="usertel">电话 ： </label><input id="usertel"
								name="usertel" value="<%=user.getTel()%>" disabled="disabled" />
						</div>
						<div>
							<label for="useraddress">住址 ： </label><input id="useraddress"
								name="useraddress" value="<%=user.getAddress()%>"
								disabled="disabled" />
						</div>
						<div>
							<label for="useremail">邮箱 ： </label><input type="email"
								id="useremail" name="useremail" value="<%=user.getEmail()%>"
								disabled="disabled" />
						</div>

						<button type="submit" style="float: right; display: none">提交</button>

					</form>
					<%
						}
					%>
				</div>
			</div>
		</div>
	</div>

	<hr />
	<div class="panel-group" id="accordion2">
		<div class="panel panel-default">
			<div class="panel-heading" style="background: #1ea2b0">
				<h4 class="panel-title">
					<a data-toggle="collapse" data-parent="#accordion2"
						href="#collapseOne2">我的会员 </a>
					<button id=""
						style="float: right; background: #1ea2b0; border: 0px"
						onclick="modify2("vip")">修改</button>
				</h4>
			</div>
			<div id="collapseOne2" class="panel-collapse collapse in">
				<div class="panel-body">
					<%
						if (userStoreVips != null) {
					%>
					<%
						for (StoreVip storeVip : userStoreVips) {
					%>
					<form id="basemessage<%=storeVip.getId() + 1%>"
						action="StoreVip/cancelVip" class="vip">
						<div>
							<input id="storeVipId" name="storeVipId" style="display: none"
								value="<%=storeVip.getId()%>" /> <label>商铺 ： <%=storeVip.getStoreId()%></label>
							<br />
							<%
								if ("0".equals(storeVip.getIsVipNow().trim())) {
							%>
							<br />
							<button style="float: right; display: none">取消vip</button>
							<%
								}
							%>
							<label>现在是否为vip ： <%
								if ("0".equals(storeVip.getIsVipNow())) {
							%> 是 <%
								} else {
							%> 否 <%
								}
							%>
							</label>

						</div>
						<div>
							<hr />
						</div>

					</form>
					<%
						}
					%>
					<%
						}
					%>
				</div>
			</div>
		</div>
	</div>

</body>
</html>